package com.ocom.oauth.po;

import lombok.Data;
import java.io.Serializable;

@Data
public class JsonResult<T> implements Serializable {

    private static final Long serialVersionUID = -1383812353246290298L;

    private Integer code;
    private String msg;
    private T data;

    public JsonResult() {
    }

    public JsonResult( String msg, T data) {
        this.code = 200;
        this.msg = msg;
        this.data = data;
    }

    public JsonResult(T data) {
        this.code = 200;
        this.msg = "success";
        this.data = data;
    }
    public JsonResult(Integer code, T data) {
        this.code = code;
        this.msg = "error";
        this.data = data;
    }
    public JsonResult(Integer code, String msg, T data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }
}

